#include <gtk/gtk.h>
#include "../common/utils.h"
#include "window_index.h"
#include "../components/component_font_awesome.h"
#include "../components/component_image.h"
#include "../components/component_right_top_button_group.h"
#include "../components/component_session.h"

struct _WindowIndex
{
    GtkWindow parent_instance;
    GtkWidget *page_left;
};

G_DEFINE_TYPE(WindowIndex, window_index, GTK_TYPE_WINDOW)

static void window_index_class_init(WindowIndexClass *klass)
{
    g_type_ensure(COMPONENT_TYPE_FONT_AWESOME);
    g_type_ensure(COMPONENT_TYPE_IMAGE);
    g_type_ensure(COMPONENT_TYPE_RIGHT_TOP_BUTTON_GROUP);
    g_type_ensure(COMPONENT_TYPE_SESSION);
    gtk_widget_class_set_template_from_resource(GTK_WIDGET_CLASS(klass), "/src/windows/window_index.ui");
    utils_load_css_from_resource("/src/windows/window_index.css");
    gtk_widget_class_bind_template_child(GTK_WIDGET_CLASS(klass), WindowIndex, page_left);
}

static void window_index_init(WindowIndex *self)
{
    gtk_widget_init_template(GTK_WIDGET(self));
    utils_widget_set_can_drag_window(GTK_WIDGET(self->page_left));
}

GtkWidget *window_index_new(void)
{
    return g_object_new(WINDOW_TYPE_INDEX, NULL);
}
